import request from '@/utils/request'

// 获取分页列表
export const getAllTrademarkListApi = (page, limit) => {
  return request.get(`/admin/product/baseTrademark/${page}/${limit}`)
}
// 使用同一个接口函数完成添加和修改
export const addTradeMarkApi = (data) => {
  const { tmName, logoUrl } = data
  return request.post(`/admin/product/baseTrademark/save`, {
    tmName,
    logoUrl
  })
}

export const updateTradeMarkApi = (data) => {
  const { id, tmName, logoUrl } = data
  return request.put(`/admin/product/baseTrademark/update`, {
    id,
    tmName,
    logoUrl
  })
}
// 删除品牌
export const remove = (id) => {
  return request.delete(`/admin/product/baseTrademark/remove/${id}`)
}
// 获取所有的品牌列表
export const getTrademarkList = () => {
  return request.get('/admin/product/baseTrademark/getTrademarkList')
}
